<template>
    <div id="FacilityAddress">
        <v-details :inputConfig="inputConfig" :detailData="inputData" :rules="rules" ref="input"></v-details>
    </div>
</template>

<script>
    import details from 'commons/Detail'
    import baseMixin from "@/mixins/BaseMixin";

    export default {
        props: {
            inputData: {
                type: Object,
            }
        },
        mixins: [baseMixin],
        name: "FacilityAddress",
        data() {
            return {
                whseidflag: false,
                rules: {},
            }
        },
        computed: {
            inputConfig() {
                return [
                    [
                        {
                            type: "input",
                            label: this.$t('config.address',{no:'1'}),
                            props: "adr1",
                            disabled: this.whseidflag
                        },
                        {
                            type: "input",
                            label: this.$t('config.address',{no:'2'}),
                            props: "adr2",
                            disabled: this.whseidflag
                        },
                        {
                            type: "input",
                            label: this.$t('config.address',{no:'3'}),
                            props: "adr3",
                            disabled: this.whseidflag
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('config.city'),
                            props: "city",
                            disabled: this.whseidflag
                        },

                        {
                            type: "input",
                            label: this.$t('config.provice'),
                            props: "state_province",
                            disabled: this.whseidflag
                        },

                        {
                            type: "input",
                            label: this.$t('config.postcode'),
                            props: "zip",
                            disabled: this.whseidflag
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('config.area'),
                            props: "district",
                            disabled: this.whseidflag
                        },
                        {
                            type: "input",
                            label: this.$t('config.area'),
                            props: "area",
                            disabled: this.whseidflag
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('config.contact'),
                            props: "contact1",
                            disabled: this.whseidflag
                        },
                        {
                            type: "input",
                            label: "电子邮箱",
                            props: "email1",
                            disabled: this.whseidflag
                        },
                        {
                            type: "input",
                            label: this.$t('config.phone'),
                            props: "phone",
                            disabled: this.whseidflag
                        },
                        {
                            type: "input",
                            label: this.$t('out.fax'),
                            props: "fax",
                            disabled: this.whseidflag
                        },
                    ],
                ]
            }
        },
        methods: {},
        mounted() {
            if (this.$store.state.wms.toUpperCase().includes('WMWHSE')) {
                //仓库级
                this.addflag = this.whseidflag = true;
            }
        },
        watch: {},
        components: {
            'v-details': details
        }
    }
</script>

<style scoped>

</style>
